__author__ = 'Administrator'
from django import forms


class ContactForm(forms.Form):
    subject = forms.CharField(max_length=100, label="The Subject:")
    email = forms.EmailField(required=False, label="You e-mail address:")
    message = forms.CharField(widget=forms.Textarea, label="the cont:")

    def clean_message(self):
        message = self.cleaned_data['message']
        num_words = len(str(message))
        print num_words
        if num_words < 4:
            raise forms.ValidationError("Not enough words!")
        return message
